﻿using System;
using System.ComponentModel;
using System.Linq;

namespace OutbreakForecast.Model
{
    public class DataRaw
    {
        public string date;

        /// <summary>
        /// 日期
        /// </summary>
        [DisplayName("日期")]
        public DateTime DateTime
        {
            get
            {
                if (date.ToArray().Count(i => i == '.') == 1)
                {
                    return DateTime.Parse("2020." + date);
                }
                else
                {
                    return DateTime.Parse(date);
                }
            }
            set
            {
                date = value.ToString("yyyy.MM.dd");
            }
        }

        public int confirm;

        /// <summary>
        /// 确诊
        /// </summary>
        [DisplayName("确诊人数")]
        public int Confirm
        {
            get
            {
                return confirm;
            }
        }

        public int heal;

        /// <summary>
        /// 治愈
        /// </summary>
        [DisplayName("治愈人数")]
        public int Heal
        {
            get
            {
                return heal;
            }
        }

        public int dead;

        /// <summary>
        /// 死亡
        /// </summary>
        [DisplayName("死亡人数")]
        public int Dead
        {
            get
            {
                return dead;
            }
        }
    }
}